//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IEvent.cpp>
///	@path	~/src/engine/runtime/
///	@date	2007/11/08
///	@desc	Event interface.

#include "config/config.h"

#include "engine/runtime/IEvent.h"

namespace xeres {

	IMPL_IOBJECT_INTERFACE( IEvent );

	// ctor
	IEvent::IEvent( void )
		: m_callback( NULL )
	{
	}

	// dtor
	IEvent::~IEvent( void )
	{
	}

	// Active
	void IEvent::Active( void * eventParam )
	{
		m_callback( eventParam );
	}

	// OnRegister
	void IEvent::OnRegister( function<void(void*)> active_callback )
	{
		assert( m_callback == NULL );
		m_callback = active_callback;
	}

} // namespace xeres
